<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	billCd		= Request("billCd")

	SQLTitle = "-- ■■■■ 거래 품목 정보 그리드 List up ■■■■"
	
	SQL = "SELECT A.lotYear, A.lotNo, A.lotSubNo, A.rank, A.goodQty, A.unitPrice, A.totalPrice, A.orderNo, CASE WHEN A.prdCd>0 THEN C.prdNm ELSE A.prdNm END prdNm, A.flag " & _
			"		FROM tblBizBill A LEFT JOIN tblProduct C ON A.prdCd=C.prdCd " & _
			"	WHERE A.billCd=" & billCd & " AND A.flag='Y' ORDER BY A.flag DESC"
	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<BillArticle>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
			
			Response.write "	<Article>" & vbcrlf
				Call mkXMLNode("lotYear", rs("lotYear"), 2)
				Call mkXMLNode("lotNo", rs("lotNo"), 2)
				Call mkXMLNode("lotSubNo", rs("lotSubNo"), 2)
				Call mkXMLNode("rank", rs("rank"), 2)
				Call mkXMLNode("goodQty", FormatNumber(rs("goodQty"),0), 2)
				Call mkXMLNode("unitPrice", FormatNumber(rs("unitPrice"),0), 2)
				Call mkXMLNode("totalPrice", FormatNumber(rs("totalPrice"),0), 2)
				Call mkXMLNode("prdNm", Rs("prdNm"), 2)
				Call mkXMLNode("orderNo", Rs("orderNo"), 2)
				Call mkXMLNode("flag", Rs("flag"), 2)
			Response.write "	</Article>" & vbcrlf

		Rs.movenext
		Loop 
	End If
	Response.write "</BillArticle>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>